# coding=utf8

# Copyright 2018 JDCLOUD.COM
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# NOTE: This class is auto generated by the jdcloud code generator program.

from jdcloud_sdk.core.jdcloudrequest import JDCloudRequest


class OpenLiveRestartRequest(JDCloudRequest):
    """
    开启回看
1、直播回看文件格式仅支持m3u8。
2、回看时长用户可以配置，最大支持7天，即用户请求回看内容，最多可以请求最近7天的直播回看内容。
3、域名格式：http://{restartDomain}/{appName}/{streamName}/index.m3u8?starttime=1527756680&endtime=1527760280 (unix时间戳)
4、starttime-endtime最长可支持24小时，可跨天

    """

    def __init__(self, parameters, header=None, version="v1"):
        super(OpenLiveRestartRequest, self).__init__(
            '/liveRestart:open', 'PUT', header, version)
        self.parameters = parameters


class OpenLiveRestartParameters(object):

    def __init__(self, restartDomain):
        """
        :param restartDomain: 回看的播放域名
        """

        self.restartDomain = restartDomain

